﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_InventoryEdit.aspx.cs" Inherits="CRM_Store_ERP_InventoryEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>盘点详情</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript" >
        function SaveClick(type) {
            if (FieldEmptyCheck2Trim(formPanel))
            {
                if (gridPanel_listdata.store.data.length > 0) {
                    Ext.net.DirectMethods.SaveData(type);
                }
                else
                    Ext.Msg.alert("系统提示", "无!");
            }
        }

    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <form id="form1" runat="server">
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout" >
        <Content>
            <ext:Panel runat="server" Border="false" Layout="RowLayout">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button ID="extBtn_Save" runat="server" Text="保存" Icon="Accept">
                                <Listeners>
                                    <Click Handler="SaveClick(0);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_SubmitInfo" runat="server" Text="提交" Icon="FolderGo">
                                <Listeners>
                                    <Click Handler="SaveClick(1);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_CheckInfo" runat="server" Text="审核" Icon="Lock">
                                <Listeners>
                                    <Click Handler="SaveClick(2);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_Exit" runat="server" Text="退出" Icon="Cancel">
                                <Listeners>
                                    <Click Fn="closeCurrTab" />
                                </Listeners>
                            </ext:Button>
                            <ext:ToolbarFill ID="ToolbarFill3" runat="server" />
                            <ext:Button ID="extBtn_Print" runat="server" Text="打印" Icon="Printer">
                                <%--<DirectEvents>
                                    <Click OnEvent="OnBtnPrintClick">
                                    </Click>
                                </DirectEvents>--%>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:Panel ID="formPanel" runat="server" Border="false" Padding="10" Height="72" Layout="ColumnLayout" >
                        <Items>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_InventoryNo" FieldLabel="盘点单号" ReadOnly="true" AnchorHorizontal="0.95" TabIndex="1" />
                                    <ext:ComboBox ID="extcomb_StoreRoomId" runat="server" FieldLabel="申请库房"
                                        AnchorHorizontal="0.95" Editable="false" ValueField="STOREROOM_ID" DisplayField="STOREROOM_NAME"
                                        TabIndex="5">
                                        <DirectEvents>
                                            <Change OnEvent="StoreChange"></Change>
                                        </DirectEvents>
                                        <Store>
                                            <ext:Store ID="Store_Rome" runat="server">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="STOREROOM_ID">
                                                        <Fields>
                                                            <ext:RecordField Name="STOREROOM_ID" />
                                                            <ext:RecordField Name="STOREROOM_NAME" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_InUserName" FieldLabel="录入人" ReadOnly="true" AnchorHorizontal="0.95" TabIndex="2"/>
                                    <ext:Hidden runat="server" ID="exthidn_InUser" />
                                    <ext:TextField runat="server" ID="exttxtf_Remark" FieldLabel="备注" MaxLength="400" AnchorHorizontal="0.95" TabIndex="6"/>
                                </Items>
                            </ext:Container>
                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                <Items>
                                    <ext:TextField runat="server" ID="exttxtf_InDate" FieldLabel="入库时间" ReadOnly="true" AnchorHorizontal="0.95" TabIndex="3"/>                                    
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Panel>
                    <ext:GridPanel runat="server" ID="gridPanel_listdata" RowHeight="1" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true" ClicksToEdit="1" >
                        <TopBar>
                            <ext:Toolbar runat="server">
                                <Items>
                                    <ext:ToolbarFill runat="server" />
                                    <ext:Button ID="extBtn_Load" runat="server" Text="加载库存信息" Icon="Add" TabIndex="12">
                                        <DirectEvents>
                                            <Click OnEvent="extBtn_Load_Click" />
                                        </DirectEvents>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel>
                            <Columns>
                                <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                <ext:Column Header="<center>商品名称</center>" Width="130" DataIndex="CargoName" />
                                <ext:Column Header="<center>商品代码</center>" Width="100" DataIndex="CargoCode" />
                                <ext:Column Header="<center>规格</center>" Width="125" DataIndex="Spec"/>
                                <ext:Column Header="<center>型号</center>" Width="150" DataIndex="Version" />
                                <ext:Column Header="<center>产地</center>" Width="120" DataIndex="Area" />
                                <ext:Column Header="<center>生产厂家</center>" Width="125" DataIndex="ProduceName"/>
                                <ext:Column Header="<center>批号</center>" Width="150" DataIndex="BatchNo" Hidden="true"/>
                                <ext:Column Header="<center>供应价格</center>" Width="100" DataIndex="Supplyprice" />
                                <ext:Column Header="<center>库存量</center>" Width="100" DataIndex="CargoCount" Hidden="true"/>
                                <ext:Column Header="<center>库存量</center>" Width="150" DataIndex="Count" />
                                <ext:Column Header="<center>总金额</center>" Width="150" DataIndex="StockPrice" />
                            </Columns>
                        </ColumnModel>
                        <Store>
                            <ext:Store runat="server" ID="Store1" AutoLoad="true">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="CargoName" />
                                            <ext:RecordField Name="CargoCode" />
                                            <ext:RecordField Name="Spec" />
                                            <ext:RecordField Name="Version"  />
                                            <ext:RecordField Name="Area" />
                                            <ext:RecordField Name="ProduceName" />
                                            <ext:RecordField Name="Supplyprice" />
                                            <ext:RecordField Name="DetailId" />
                                            <ext:RecordField Name="Count"/>
                                            <ext:RecordField Name="StoreRoomId"/>
                                            <ext:RecordField Name="STOREROOM_NAME"/>
                                            <ext:RecordField Name="BatchNo"/>
                                            <ext:RecordField Name="StockPrice" />
                                            <ext:RecordField Name="StockCount" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <SelectionModel>
                            <ext:RowSelectionModel runat="server" SingleSelect="true" />
                        </SelectionModel>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
